﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Edit.Master"  AutoEventWireup="true"  CodeBehind="Bu_AuditBatch_Edit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Audit.Bu_AuditBatch_Edit"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	
<script language="javascript" type="text/javascript">
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
					<%= numBatchNo.UniqueID%>:{required: true,digits: true},
					<%= ddlBatchStatus.UniqueID%>:{required: true}					
                 },
                 messages:
                 {
					<%= numBatchNo.UniqueID%>:{required: "批次 请输入合适的值",digits: "批次 请输入有效的整数"},
					<%= ddlBatchStatus.UniqueID%>:{required: "状态 请选择合适的值"}					
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>* "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">资金审核批次维护</th>
        </table>
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit">
		<tr>
			<td style="width:100px;" class="title1">批次</td>
			<td><asp:TextBox ID="numBatchNo" runat="server" Enabled="false" cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isInt();" Width="96%"></asp:TextBox></td>
            <td style="width:100px;" class="title1">状态</td>
			<td><asp:DropDownList ID="ddlBatchStatus"  Enabled="false" runat="server" cssClass="input2"  Width="98%"></asp:DropDownList></td>
		</tr>
		<tr>
			<td class="title1">预计开始时间</td>
			<td><asp:TextBox ID="dtpPStartDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
			<td class="title1">预计结束时间</td>
			<td><asp:TextBox ID="dtpPEndDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">开始时间</td>
			<td><asp:TextBox ID="dtpStartDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
			<td class="title1">结束时间</td>
			<td><asp:TextBox ID="dtpEndDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		</tr>
        <tr>
            <td class="title1">创建人</td>
			<td><asp:TextBox ID="txtCreator" runat="server"  Enabled="false" cssClass="input2" MaxLength="36" Width="96%"></asp:TextBox>
            <asp:HiddenField runat="server" ID="hidCreator" />
            </td>
            <td class="title1">创建时间</td>
			<td><asp:TextBox ID="dtpCreateTime" runat="server" Enabled="false" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
        </tr>
        
		<tr>
			<td class="title1">批次说明</td>
			<td colspan="3"><asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Rows="4" cssClass="input2" MaxLength="500" Width="98%"></asp:TextBox></td>			
		</tr>
        <tr>
            <td class="title1">本批次包含合同</td>
            <td colspan="3">
                <div class="button_area">
        <asp:Button runat="server" ID="Button1" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="导入接收表" 
                        OnClientClick="return mImportRec();" onclick="Button1_Click"/>
        <asp:Button runat="server" ID="btnAdd" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="选择合同" style="display:none" onclick="btnAdd_Click"/>
        <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="删 除" 
            OnClientClick="javascript:return getNoSelectionAlert('chkID','请选择要删除的记录后再执行此操作！');" onclick="btnDelete_Click"             
            />
    </div>
                <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1">                   
                    <thead>  
                        <th align="center" width="30px">
                            <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
                        </th>
                        <th width="60px">回执编号</th>
                        <th>项目名称</th>
                        <th>合同名称</th>
                        <th width="80px">申请资金</th>
                    </thead>
                    <asp:Repeater runat="server" ID="rptBatchContract">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ContractID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ContractID") %>" >
                                </td>
                                <td><%# DataBinder.Eval(Container.DataItem, "Code")%>
                                <td align="left"><%# DataBinder.Eval(Container.DataItem, "ProjectSN")%>&nbsp;&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "ProjectName")%></td>
                                <td align="left"><%# DataBinder.Eval(Container.DataItem,"ContractName") %>
                                </td>
                                <td align="right"><%# string.Format("{0:0.00}", DataBinder.Eval(Container.DataItem,"Amount")) %></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </td>
        </tr>
        </table>
        <asp:HiddenField runat="server" ID="hidID" />
        <asp:HiddenField runat="server" ID="hidContractIDString" />
        <asp:HiddenField runat="server" ID="hidRecIDString" />
        <asp:Button runat="server" ID="btnReBind" style="display:none" onclick="btnReBind_Click" />
        <div class="save_area">
            <asp:Button runat="server" ID="btnOK" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" onclick="btnOK_Click"/>
            <input type="button" id="btnExit" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
        <script language="javascript" type="text/javascript">
            function mImportRec() {
                var str = document.getElementById("<%=hidContractIDString.ClientID %>").value;
                var strRecID = document.getElementById("<%=hidRecIDString.ClientID %>").value;
                var arrConID = null;
                if (str != "") {
                    arrConID = str.split(",");
                }
                var retValue = window.showModalDialog('SelectDocRec.aspx?randId=' + escape(new Date()), arrConID, 'scroll:0;status:0;help:1;resizable:0;dialogWidth:900px;dialogHeight:600px');
                if (typeof (retValue) != "undefined" && retValue != null && retValue.length > 0) {
                    for (var i = 0; i < retValue.length; i++) {
                        if (str != "") {
                            str += ",";
                        }
                        str += retValue[i].ConID;
                        if (strRecID != "") {
                            strRecID += ",";
                        }
                        strRecID += retValue[i].RecID;
                        //alert(retValue[i].RecID + "|" + retValue[i].ConID);
                    }
                    document.getElementById("<%=hidContractIDString.ClientID %>").value = str;
                    document.getElementById("<%=hidRecIDString.ClientID %>").value = strRecID;
                    return true;
                }
                return false; 
            }
            function mSelectContract() {
                return true;
            }
            function RetData() {
                var RecID;
                var ConID;
            }
        </script>
</asp:Content>


